package architect.design.patterns.structural.composite.simple;

/**
 * 开发人员
 *
 * @author guanxin
 * @date 2018/5/5 14:59
 */

public class Developer implements IEmployee {

    private String name;
    private double salary;

    public Developer(String name, double salary) {
        this.name = name;
        this.salary = salary;
    }

    public void add(IEmployee employee) {
        String msg = "nothing subordinate.";;
        throw new UnsupportedOperationException(msg);
    }

    public void remove(IEmployee employee) {
        String msg = "nothing subordinate.";;
        throw new UnsupportedOperationException(msg);
    }

    public IEmployee getChild(int i) {
        String msg = "nothing subordinate.";;
        throw new UnsupportedOperationException(msg);
    }

    public String getName() {
        return this.name;
    }

    public double getSalary() {
        return this.salary;
    }

    public void print() {
        System.out.println("-------------");
        System.out.println("Name ="+getName());
        System.out.println("Salary ="+getSalary());
        System.out.println("-------------");
    }
}
